package com.dsx.wechat.token;

import com.dsx.common.Constant;
import com.dsx.wechat.button.CreateMenu;
import org.apache.commons.collections.bag.SynchronizedSortedBag;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;

/**
 * Created by tianwenqing on 2017/9/6.
 */
public class TokenTest1 {
    public static void main(String[] args) throws Exception {
        Token token = CommonUtil.getToken(Constant.APPID, Constant.APPSECRET);
        System.out.println(token.getAccessToken());
        System.out.println(token.getExpiresIn());

        int menu = CommonUtil.createMenu(CreateMenu.getMenu(), token.getAccessToken());
        System.out.println(menu);
    }
}
